package com.cnswhy.cloud.server.core.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cnswhy.cloud.common.core.base.entity.Entity;
import com.cnswhy.cloud.server.common.entity.enumeration.WithdrawType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import java.time.LocalDateTime;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 
 * </p>
 *
 * @author cnswhy
 * @since 2020-10-14
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_customer_withdrawal_record")
@ApiModel(value = "CustomerWithdrawalRecord", description = "")
@AllArgsConstructor
public class CustomerWithdrawalRecord extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 客户ID
     */
    @ApiModelProperty(value = "客户ID")
    @TableField("customer_id")
    @Excel(name = "")
    private Long customerId;
    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "login_name", condition = LIKE)
    @Excel(name = "登录手机号")
    private String loginName;
    /**
     * 交易金额
     */
    @ApiModelProperty(value = "交易金额")
    @TableField("trans_amount")
    @Excel(name = "交易金额")
    private Long transAmount;

    /**
     * 交易手续费
     */
    @ApiModelProperty(value = "交易手续费")
    @TableField("trans_fee")
    @Excel(name = "交易手续费")
    private Long transFee;

    /**
     * 结算金额
     */
    @ApiModelProperty(value = "结算金额")
    @TableField("sett_amt")
    @Excel(name = "结算金额")
    private Long settAmt;




    /**
     * 1待审核2审核通过3审核拒绝
     */
    @ApiModelProperty(value = "1待审核2审核通过3审核拒绝")
    @TableField("verify_status")
    @Excel(name = "审核状态", replace = {"待审核_1", "审核通过_2",  "审核拒绝_3"})
    private Integer verifyStatus;

    /**
     * 1提现中2提现成3提现失败
     */
    @ApiModelProperty(value = "1提现中2提现成3提现失败")
    @TableField("status")
    @Excel(name = "提现状态", replace = {"提现中_1", "提现成功_2",  "提现失败_3"})
    private Integer status;

    /**
     * 系统订单号
     */
    @ApiModelProperty(value = "系统订单号")
    @Length(max = 32, message = "系统订单号长度不能超过32")
    @TableField(value = "order_id", condition = LIKE)
    @Excel(name = "系统订单号")
    private String orderId;

    /**
     * 渠道订单号
     */
    @ApiModelProperty(value = "渠道订单号")
    @Length(max = 255, message = "渠道订单号长度不能超过255")
    @TableField(value = "channel_order_id", condition = LIKE)
    @Excel(name = "渠道订单号")
    private String channelOrderId;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "remark", condition = LIKE)
    @Excel(name = "")
    private String remark;

    /**
     * 1积分2拼购券
     */
    @ApiModelProperty(value = "1积分2拼购券")
    @TableField("balance_type")
    @Excel(name = "账户类型", replace = {"积分_1", "余额_2"})

    private Integer balanceType;



    /**
     * 权限类型 #WithdrawType{BANKCARD:银行卡;ALIPAY:支付宝账号;}
     */
    @ApiModelProperty(value = "权限类型 #WithdrawType{BANKCARD:银行卡;ALIPAY:支付宝账号;}")
    @TableField("withdraw_type")
    @Excel(name = "提现类型", replace = {"银行卡_BANKCARD", "支付宝账号_ALIPAY",  "_null"})
    private WithdrawType withdrawType;

    /**
     * 支行
     */
    @ApiModelProperty(value = "支行")
    @Length(max = 255, message = "支行长度不能超过255")
    @TableField(value = "bank_branch", condition = LIKE)
    @Excel(name = "支行")
    private String bankBranch;

    /**
     * 手机号
     */
    @ApiModelProperty(value = "手机号")
    @Length(max = 12, message = "手机号长度不能超过12")
    @TableField(value = "mobile", condition = LIKE)
    @Excel(name = "手机号")
    private String mobile;

    /**
     * 账号
     */
    @ApiModelProperty(value = "账号")
    @Length(max = 32, message = "账号长度不能超过32")
    @TableField(value = "withdraw_account", condition = LIKE)
    @Excel(name = "账号")
    private String withdrawAccount;

    /**
     * 真实名字
     */
    @ApiModelProperty(value = "真实名字")
    @Length(max = 255, message = "真实名字长度不能超过255")
    @TableField(value = "real_name", condition = LIKE)
    @Excel(name = "真实名字")
    private String realName;

    /**
     * 身份证
     */
    @ApiModelProperty(value = "身份证")
    @Length(max = 18, message = "真实名字长度不能超过18")
    @TableField(value = "id_card", condition = LIKE)
    @Excel(name = "身份证")
    private String idCard;
    @TableField(value = "verify_time")
    @Excel(name = "审核时间")
    private LocalDateTime verifyTime;
    @TableField(value = "sett_date")
    @Excel(name = "结算日期")
    private String settDate;


    @Builder
    public CustomerWithdrawalRecord(Long id, LocalDateTime createTime, LocalDateTime updateTime, Long createUser, Long updateUser,
                                    Long customerId, Long transAmount, Long transFee, Long settAmt, Integer verifyStatus,
                                    Integer status, String orderId, String channelOrderId, String remark, Integer balanceType, String loginName,
                                    WithdrawType withdrawType, String bankBranch, String mobile, String withdrawAccount, String realName, String idCard, String settDate, LocalDateTime verifyTime) {
        this.id = id;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.createUser = createUser;
        this.updateUser = updateUser;
        this.customerId = customerId;
        this.transAmount = transAmount;
        this.transFee = transFee;
        this.settAmt = settAmt;
        this.verifyStatus = verifyStatus;
        this.status = status;
        this.orderId = orderId;
        this.channelOrderId = channelOrderId;
        this.remark = remark;
        this.balanceType = balanceType;
        this.loginName = loginName;
        this.withdrawType = withdrawType;
        this.bankBranch = bankBranch;
        this.mobile = mobile;
        this.withdrawAccount = withdrawAccount;
        this.realName = realName;
        this.idCard = idCard;
        this.verifyTime = verifyTime;
        this.settDate = settDate;
    }

}
